﻿@model WoodAdmin.Models.ViewModels.IndexViewModel
@{
    var count = 0;
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>WestWood</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="~/plugins/layui/css/layui.css" media="all" asp-append-version="true" />
    <link rel="stylesheet" href="~/css/index/index.css" media="all" asp-append-version="true" />
    <link href="~/plugins/font-awesome-4.7.0/css/font-awesome.css" rel="stylesheet" />
</head>

<body class="main_body">
    <div class="layui-layout layui-layout-admin">
        <!-- 顶部 -->
        <div class="layui-header header">
            <div class="layui-main mag0">
                <a href="#" class="logo">WoodAdmin</a>
                <!-- 显示/隐藏菜单 -->
                <a href="javascript:;"><i class="fa fa-bars" aria-hidden="true"></i></a>
                <!-- 顶级菜单 -->
                <ul class="layui-nav mobileTopLevelMenus" mobile>
                    <li class="layui-nav-item" data-menu="@Model.GroupList.FirstOrDefault()?.Name">
                        <dl class="layui-nav-child">
                            @foreach (SysGroup group in Model.GroupList)
                            {
                                if (Model.NodeList.Count(s => s.GroupID == group.ID && s.NodeLevel == 3 && s.DisplayFlag == 1) == 0)
                                {
                                    continue;
                                }
                                if (count == 0)
                                {
                                    <dd data-menu="@group.Name" class="layui-this"><a href="javascript:;"><i class="@group.IcoCss" aria-hidden="true"></i><cite>@group.Title</cite></a></dd>
                                }
                                else
                                {
                                    <dd data-menu="@group.Name"><a href="javascript:;"><i class="@group.IcoCss" aria-hidden="true"></i><cite>@group.Title</cite></a></dd>
                                }
                            }
                        </dl>
                    </li>
                </ul>
                <ul class="layui-nav topLevelMenus" pc>
                    @foreach (SysGroup group in Model.GroupList)
                    {
                        if (Model.NodeList.Count(s => s.GroupID == group.ID && s.NodeLevel == 3 && s.DisplayFlag == 1) == 0)
                        {
                            continue;
                        }
                        if(count==0){
                            <li class="layui-nav-item layui-this" data-menu="@group.Name">
                                <a href="javascript:;"><i class="@group.IcoCss" aria-hidden="true"></i><cite>@group.Title</cite></a>
                            </li>
                        }else{
                            <li class="layui-nav-item" data-menu="@group.Name">
                                <a href="javascript:;"><i class="@group.IcoCss" aria-hidden="true"></i><cite>@group.Title</cite></a>
                            </li>
                        }
                        count++;
                    }
                </ul>
                <!-- 顶部右侧菜单 -->
                <ul class="layui-nav top_menu">
                    <li class="layui-nav-item" pc>
                        <a href="javascript:;" class="clearCache"><i class="fa fa-eraser" aria-hidden="true"></i><cite>清除缓存</cite></a>
                    </li>
                    @*<li class="layui-nav-item lockcms" pc>
                        <a href="javascript:;"><i class="fa fa-lock" aria-hidden="true"></i><cite>锁屏</cite></a>
                    </li>*@
                    <li class="layui-nav-item" id="userInfo">
                        <a href="javascript:;"><img src="~/images/index/face.jpg" class="layui-nav-img userAvatar" width="35" height="35"><cite class="adminName">@Model.UserInfo.Name</cite></a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" data-url="/SysUser/UpdatePassword"><i class="fa fa-key" aria-hidden="true"></i></i><cite>修改密码</cite></a></dd>
                            <dd pc><a href="javascript:;" class="functionSetting"><i class="fa fa-sun-o" aria-hidden="true"></i><cite>功能设定</cite></a></dd>
                            <dd pc><a href="javascript:;" class="changeSkin"><i class="fa fa-th-large" aria-hidden="true"></i><cite>更换皮肤</cite></a></dd>
                            <dd><a class="signOut" onclick="signout()"><i class="fa fa-sign-out" aria-hidden="true"></i><cite>退出登录</cite></a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 左侧导航 -->
        <div class="layui-side layui-bg-black">
            <div class="user-photo">
                <a class="img" title="我的头像"><img src="~/images/index/face.jpg" class="userAvatar"></a>
                <p>你好！<span class="userName">@Model.UserInfo.Name</span></p>
            </div>

            <div class="navBar layui-side-scroll" id="navBar">
                <ul class="layui-nav layui-nav-tree">
                    <li class="layui-nav-item layui-this">
                        <a href="javascript:;" data-url="/Home/Main"><i class="fa fa-home" aria-hidden="true"></i><cite>后台首页</cite></a>
                    </li>
                </ul>
            </div>
        </div>

        <!-- 右侧内容 -->
        <div class="layui-body layui-form">
            <div class="layui-tab mag0" lay-filter="bodyTab" id="top_tabs_box">
                <ul class="layui-tab-title top_tab" id="top_tabs">
                    <li class="layui-this" lay-id=""><i class="fa fa-home" aria-hidden="true"></i><cite>后台首页</cite></li>
                </ul>
                <ul class="layui-nav closeBox">
                    <li class="layui-nav-item">
                        <a href="javascript:;"><i class="fa fa-cogs" aria-hidden="true"></i> 页面操作</a>
                        <dl class="layui-nav-child">
                            <dd><a href="javascript:;" class="refresh refreshThis"><i class="fa fa-refresh" aria-hidden="true"></i> 刷新当前</a></dd>
                            <dd><a href="javascript:;" class="closePageOther"><i class="fa fa-close" aria-hidden="true"></i> 关闭其他</a></dd>
                            <dd><a href="javascript:;" class="closePageAll"><i class="fa fa-close" aria-hidden="true"></i> 关闭全部</a></dd>
                        </dl>
                    </li>
                </ul>
                <div class="layui-tab-content clildFrame">
                    <div class="layui-tab-item layui-show">
                        <iframe src="@(string.IsNullOrEmpty(ViewBag.ReturnUrl as string)?"/Home/Main":ViewBag.ReturnUrl)" id="iframe"></iframe>
                    </div>
                </div>
            </div>
        </div>

        <!-- 底部 -->
        <div class="layui-footer footer">
           <p><span>copyright 2020</span></p>
        </div>
    </div>

    <!-- 移动导航 -->
    <div class="site-tree-mobile"><i class="layui-icon">&#xe602;</i></div>
    <div class="site-mobile-shade"></div>
    <script type="text/javascript" src="~/plugins/layui/layui.js"></script>
    <script type="text/javascript" src="~/js/index/index.js" asp-append-version="true"></script>
    <script type="text/javascript" src="~/js/index/cache.js" asp-append-version="true"></script>

    <script>
        //用户登出
        function signout() {
            layer.confirm("确定退出？", { icon: 3, title: '提示' }, function (index) {
                layer.close(index);
                window.location.href = "/SysUser/Logout";
            });
        }
    </script>
</body>
</html>